/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package tests;
import java.util.logging.Level;
import java.util.logging.Logger;
import views.*;
import controllers.*;
import models.*;

/**
 *
 * @author tlnguyen
 */
public class TestGhatGui {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        try {
            // create a gui and a controller
            ChatGui gui = new ChatGui();
            ChatController cont = new ChatController();
            cont.setGui(gui);
            gui.setController(cont);

            // run the gui
            new Thread(gui).start();

            // wait for logging in
            while(cont.getLUser() == null){
            }
            // add 3 contacts in the list
            Contact tlnguyen = new Contact("long", "son adresse");
            Contact suzanne = new Contact("suzanne", "son adresse");
            Contact fatim = new Contact("fatim", "son adresse");
            Thread.currentThread().sleep(3000);
            cont.newContact(tlnguyen, false);
            Thread.currentThread().sleep(3000);
            cont.newContact(suzanne, false);
            Thread.currentThread().sleep(3000);
            cont.newContact(fatim, false);

            // remove fatim from the list
            Thread.currentThread().sleep(5000);
            cont.removeContact(fatim);

        } catch (InterruptedException ex) {
            Logger.getLogger(TestGhatGui.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

}
